﻿using System;
using System.Collections;
using System.Linq;
using System.Web;
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class emailControl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        tbFrom.Enabled = false;        
    }
    protected void btnSend_Click(object sender, EventArgs e)
    {
        


    email mail = new email(tbTo.Text.ToString(), tbFrom.Text.ToString(), tbSubject.Text.ToString(), tbMessage.Text.ToString());
        
    mail.sendMail();

   btnSend.Enabled = false;
   tbTo.Enabled = false;
     tbMessage.Enabled = false;
     tbSubject.Enabled = false;
     Label1.Text = "Email Sent";



    }
  
    protected void btnReset_Click(object sender, EventArgs e)
    {
        tbMessage.Text = string.Empty;
        tbTo.Text = string.Empty;
        tbSubject.Text = string.Empty;
        
    }
    
  
    protected void btnSOver_Click(object sender, EventArgs e)
    {
        Response.Redirect(Request.Url.ToString());           
    }
}
